// 文件上传

import axios from 'axios';
// import { getToken } from '@/utils/auth';

export const FileUpload = (file: any) => {
  return new Promise((resolve, reject) => {
    axios({
      method: 'post',
      url: 'http://192.168.31.140:19004/basis/file/upload',
      headers: {
        'Content-Type': 'multipart/form-data;charset=UTF-8',
        Authorization: '`${getToken()}`'
      },
      data: file,
      onUploadProgress(e) {
        let msg = (e.loaded / e.total) * 100;
      }
    }).then((res) => {
      resolve(res);
    });
  });
};
